<?php

use Dingo\Api\Routing\Router;
use \App\Commons\Utils\RouterActionPrefixTools;
use \App\Admin\Controller\Auth\UserController;

/** @var Router $api */
$api = app(Router::class);

$api->group(['prefix' => 'auth'], function (Router $api) {
    
    $api->group(['prefix' => 'user'], function (Router $api) {
        $rapt = new RouterActionPrefixTools(UserController::class);
        
        /** @see UserController::login() 用户登录接口 */
        $api->post('login', $rapt->getAction('login'));
        
        /** @see UserController::logout() */
        $api->post('logout', $rapt->getAction('logout'))->name('用户退出');
    });
    
});